void main() {
  assert(2 + 3 == 5);
  print('2 + 3 = ${2 + 3}');
  assert(2 - 3 == -1);
  print('2 - 3 = ${2 - 3}');
  assert(2 * 3 == 6);
  print('2 * 3 = ${2 * 3}');
  assert(5 / 2 == 2.5); // 结果是 double
  print('5 / 2 = ${5 / 2}');
  assert(5 ~/ 2 == 2); // 结果是 int
  print('5 ~/ 2 = ${5 ~/ 2}');
  assert(5 % 2 == 1); // 余数
  print('5 % 2 = ${5 % 2}');
  print('5/2 = ${5 ~/ 2} r ${5 % 2}');

  int a;
  int b;

  a = 0;
  b = ++a; // a 先自增，然后赋值给 b
  assert(a == b); // 1 == 1
  print('++a: a = $a, b = $b');

  a = 0;
  b = a++; // a 先赋值给 b，然后自增
  assert(a != b); // 1 != 0
  print('a++: a = $a, b = $b');

  a = 0;
  b = --a; // a 先自减，然后赋值给 b
  assert(a == b); // -1 == -1
  print('--a: a = $a, b = $b');

  a = 0;
  b = a--; // a 先赋值给 b，然后自减
  assert(a != b); // -1 != 0
  print('a--: a = $a, b = $b');
}
